package com.aaa.car.service.impl;

import com.aaa.car.dao.CarDao;
import com.aaa.car.service.CarService;
import com.aaa.common.entity.Car;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ypy
 * @since 2020-07-30
 */
@Service
public class CarServiceImpl extends ServiceImpl<CarDao, Car> implements CarService {

    @Autowired
    private CarDao carDao;

    @Override
    public PageInfo getAllCar(Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum,pageSize);
        List<HashMap> list = carDao.getAllCar();
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }
}
